***********************
*Presidential Success in Surpeme Court Appointments:
*Informational Effects & Institutional Constraints
*By Matthew P. Hitt
*Stata Replication Commands
*Use: Hitt 2013 PSQ Replication Dataset.dta
***********************

*******************
*Tables
*******************

*Table 1

xtmixed bgapterm logallyrexp || name:, var

xtmixed bgapterm logyreb || name:, var

xtmixed bgapterm logyrfed || name:, var

xtmixed bgapterm polarization || name:, var

xtmixed bgapterm divpar || name:, var

xtmixed bgapterm logallyrexp polarization divpar || name:, var

*Table 2

kwallis bgapterm, by(divpar)
kwallis bgapterm, by(hipolar)
kwallis bgapterm, by(regime)
kwallis bgapterm, by(hiexpmean)

*Table 3

kwallis logallyrexp if freshterm == 1, by(regime)
	*We need to restrict this test with the "if freshterm == 1" command so that we only count each justice's experience once.
	
******************
*Figures
******************

*Figure 3 

graph hbox bgapterm, over(name2, sort(1))

*Figure 4

scatter logallyrexp yearatappt, ml(name2) mlabv(graphclock) xscale(range(1950(10)2010)) xlabel(1950(10)2010)

*****************
*Supporting Information
*****************

*Table S1

xtmixed bgapterm logallyrexp regime divpar || name:, var

xtmixed bgapterm logallyrexp DWnom1gap divpar || name:, var

*Table S2

xtmixed bgapterm logallyrexp polarization divpar || name: if natct == 1, var

*Table S3

xtmixed bgapterm logallyrexp polarization divpar year || name:, var
xtmixed bgapterm logallyrexp polarization divpar roe || name:, var
xtmixed bgapterm logallyrexp polarization divpar post68 || name:, var

*Table S4

xtgee bgapterm logallyrexp polarization divpar, c(exc) i(namenum)

*Table S5

xtmixed bgapterm logallyrexp polarization divpar recess || name:, var
xtmixed bgapterm logallyrexp polarization divpar scqual || name:, var
xtmixed bgapterm logallyrexp polarization divpar age || name:, var
xtmixed bgapterm logallyrexp polarization divpar voice || name:, var
xtmixed bgapterm logallyrexp polarization divpar freshterm || name:, var
xtmixed bgapterm logallyrexp polarization divpar identity || name:, var

*Table S6

reg bgapterm logallyrexp polarization divpar, cluster(name)

*Table S7

kwallis experience if strongPres == 1 & freshterm == 1, by(fullconst)
kwallis experience if strongPres == 0 & freshterm == 1, by(fullconst)

*****************
*Notes
*****************
	
*Endnote 6 

xtmixed bgapterm logallyrexp || name:, var
estat ic
xtmixed bgapterm logyreb || name:, var
estat ic
xtmixed bgapterm logyrfed || name:, var
estat ic
xtmixed bgapterm logyrfed logyreb || name:, var
estat ic

*Endnote 9

xtmixed bgapterm logallyrexp polarization divpar || name: if termcount < 10, var
xtmixed bgapterm logallyrexp polarization divpar || name: if termcount < 9, var
xtmixed bgapterm logallyrexp polarization divpar || name: if termcount < 8, var
xtmixed bgapterm logallyrexp polarization divpar || name: if termcount < 7, var
xtmixed bgapterm logallyrexp polarization divpar || name: if termcount < 6, var
xtmixed bgapterm logallyrexp polarization divpar || name: if termcount < 5, var
xtmixed bgapterm logallyrexp polarization divpar || name: if termcount < 4, var
xtmixed bgapterm logallyrexp polarization divpar || name: if termcount < 3, var
xtmixed bgapterm logallyrexp polarization divpar || name: if termcount < 2, var

*Endnote 10

kwallis bgapterm if regime != 0, by(regime)
kwallis bgapterm if regime != 1, by(regime)
kwallis bgapterm if regime != 2, by(regime)

*Endnote 11

spearman logallyrexp bgapterm if regime == 0, stats(rho p)
spearman logallyrexp bgapterm if regime == 1, stats(rho p)
spearman logallyrexp bgapterm if regime == 2, stats(rho p)

*Endnote 15

xtmixed bgapterm logallyrexp divpar || name:, var
xtmixed bgapterm logallyrexp regime || name:, var
xtmixed bgapterm logallyrexp DWnom1gap || name:, var
xtmixed bgapterm logallyrexp polarization || name:, var
xtmixed bgapterm logallyrexp divpar regime || name:, var
xtmixed bgapterm logallyrexp polarization regime || name:, var
xtmixed bgapterm logallyrexp DWnom1gap regime || name:, var


